import { defineStore } from 'pinia'
import { ref } from 'vue'
//用户模块

export const useUserStore = defineStore(
  'user',
  () => {
    const token = ref('')
    const setToken = (value) => {
      token.value = value
    }
    const removeToken = () => {
      token.value = ''
    }

    const userInof = ref({})

    const setUserInof = (obj) => {
      userInof.value = obj
    }
    const getUserInof = () => {
      return userInof.value
    }

    return {
      token,
      setToken,
      removeToken,
      userInof,
      setUserInof,
      getUserInof
    }
  },
  {
    persist: true
  }
)
